package com.principle.interpret;

import java.util.HashMap;
//变量的解释器，
public class VarExpression extends Expression{
    //key=q,b,c...
    private String key;

    public VarExpression(String key) {
        this.key = key;
    }
    //var 就是{a=20,b=10...}
    //interpreter 根据 变量名称，返回对应值
    @Override
    public int interpreter(HashMap<String, Integer> var) {
        return var.get(this.key);
    }
}
